//
//  AppercitionTCell.m
//  Lovelife
//
//  Created by dllo on 15/4/21.
//  Copyright (c) 2015年 dllo. All rights reserved.
//


#import "AppercitionTCell.h"
#import "UIImageView+WebCache.h"
#import "NightManager.h"
@implementation AppercitionTCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.photoView = [[UIImageView alloc]init];
        [self.contentView addSubview:self.photoView];
        [_photoView release];
        
        self.titleLabel = [[BaseLabel alloc]init];
        self.titleLabel.numberOfLines = 0;
        self.titleLabel.text = self.apperciation.title;
        [self.contentView addSubview:self.titleLabel];
        [_titleLabel release];
        
        self.timeLabel = [[BaseLabel alloc]init];
        self.timeLabel.text = self.apperciation.time;
        [self.contentView addSubview:self.timeLabel];
        [_timeLabel release];
        
        self.anotherLabel = [[BaseLabel alloc]init];
        [self.contentView addSubview:self.anotherLabel];
        self.anotherLabel.text = self.apperciation.author;
        [_anotherLabel release];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.photoView.frame = CGRectMake(30, 10, 80, 100);
    
    
    self.titleLabel .frame = CGRectMake(120, 10, 200, 50);
    
    
    self.timeLabel.frame = CGRectMake(120, 60, 200, 25);
    
    
    self.anotherLabel.frame = CGRectMake(120, 85, 200, 28);
    

}

- (void)dealloc
{
    [_timeLabel release];
    [_titleLabel release];
    [_anotherLabel release];
    [_photoView release];
    [_apperciation release];
    [super dealloc];
}

- (void)setLightDayModel
{
    [NightManager setLabelColorWithLabel:self.titleLabel];
    [NightManager setLabelColorWithLabel:self.titleLabel];
    [NightManager setLabelColorWithLabel:self.anotherLabel];
    [NightManager setBackgroundColorWithView:self.photoView];
    [NightManager setBackgroundColorWithView:self];
}

- (void)setNightDayModel
{
    [NightManager setLabelColorWithLabel:self.titleLabel];
    [NightManager setLabelColorWithLabel:self.titleLabel];
    [NightManager setLabelColorWithLabel:self.anotherLabel];
    [NightManager setBackgroundColorWithView:self.photoView];
    [NightManager setBackgroundColorWithView:self];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
